<!doctype html>
<html  class="x-admin-sm">
  {include file="Admin/Public/head" title="管理后台登录" /}
  <link rel="stylesheet" href="/static/admin/css/login.css">
<body class="login-bg">
    
    <div class="login layui-anim layui-anim-up">
        <div class="message">管理后台登录</div>
        <div id="darkbannerwrap"></div>
        
        <form method="post" class="layui-form" >
            <input name="username" placeholder="用户名" type="text" lay-verify="username" class="layui-input" >
            <hr class="hr15">
            <input name="password" lay-verify="password" placeholder="密码" autocomplete="off" type="password" class="layui-input">
            <hr class="hr15">
            <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit">
            <hr class="hr20" >
        </form>
    </div>

    <script>
        $(function  () {
            layui.use('form', function(){
              var form = layui.form;
              form.verify({
                username: function(value){
                  if(value == ''){
                    return '用户名不能为空';
                  }
                }
                ,password: function(value){
                  if(value == ''){
                    return '密码不能为空';
                  }
                }
              });
              form.on('submit(login)', function(data){
                layer.load(2);
                $.post("/admin/loginDo.html",data.field,function(data){
                    layer.closeAll();
                    if (data.code == 200) {
                        layer.msg(data.msg,{time:1000},function(){
                            location.href="/admin";
                        });
                    } else if (data.code == 500) {
                        layer.msg(data.msg,{time:1500});
                    }
                })
                return false;
              });
            });
        })
    </script>
    <!-- 底部结束 -->
    <script>
    //百度统计可去掉
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
    </script>
</body>
</html>